<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="demo">
        <p>a.b:{{a.b}}</p><br>
        <p>a.c:{{a.c}}</p><br>
        <button @click="updata">更新</button>
    </div>
    <script src="../day02/js/vue.js"></script>
    <script>
        /* 
        
        */
       new Vue({
           el:'#demo',
           data:{
               a:{
                   b:"abc",
               }
           },
           methods: {
               updata(){
                //  使用Vue的静态方法set delete 
                //    直接添加一个属性
                //    this.a.c = 123;
                // Vue.set(this.a,'c',123);
                // this.$set(this.a,'c',123);
                // 直接删除一个属性
                // delete this.a.b;
                Vue.delete(this.a,'b');
                // this.$delete(this.a,'b');
               }
           }
       })
    </script>
</body>
</html>